<div>
 <%= error_messages_for 'user'%>
 <fieldset>
   <legend>注册</legend>
   <% form_for :user do |form|%>
     <p>
       <label for="user_email">用户名（E-mail）:</label>
       <%=form.text_field:email,:size=>30 %>
     </p>  
     <p>
       <label for="user_nick_name">昵称:</label>
       <%=form.text_field:nick_name,:size=>15 %>
     </p>
     <p>
       <label for="user_password" >密码:</label>
       <%= form.password_field:password,:size=>20 %>
     </p>
     <p>
       <label for="user_password_confirmation" >密码确认:</label>
       <%=form.password_field:password_confirmation,:size=>20%>
     </p>
<%=submit_tag "注册",:class=>"submit" %>
<%= link_to "登录",:action =>:index%>
   <% end%>
 </fieldset>
</div>
